Skip to content

Conversation

@adierking
Copy link
Contributor

_dispatch_operation_perform() uses _aligned_malloc() on Windows to
allocate the data buffer. This means that we cannot use
DISPATCH_DATA_DESTRUCTOR_FREE when we create the dispatch_data_t.
Provide a custom destructor which correctly frees the buffer.

Discovered while porting the dispatch_io test to Windows.

`_dispatch_operation_perform()` uses `_aligned_malloc()` on Windows to
allocate the data buffer. This means that we cannot use
`DISPATCH_DATA_DESTRUCTOR_FREE` when we create the `dispatch_data_t`.
Provide a custom destructor which correctly frees the buffer.

Discovered while porting the dispatch_io test to Windows.
@adierking
Copy link
Contributor Author

cc @compnerd @ktopley-apple

@ktopley-apple
Copy link
Contributor

@swift-ci please test

@ktopley-apple ktopley-apple merged commit c5af10f into swiftlang:master Jun 11, 2019
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
io: free Windows operation data with _aligned_free()
Signed-off-by: Kim Topley <ktopley@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants